<template>
    <div>

        <!--        <el-button @click="test">测试</el-button>-->

        <!--        条件输入信息框     -->
        <el-card style="width: 100%; height: 17vh;">
            <div style="display: flex">
                <div style="flex: 1;margin-right: 50px">
                    <el-form>

                        <el-form-item label="标题">
                            <el-input style="" clearable v-model="searchTitle" placeholder="请输入标题"></el-input>
                        </el-form-item>

                        <el-form-item label="内容" style="">
                            <el-input style="" clearable v-model="searchContent" placeholder="请输入内容"></el-input>
                        </el-form-item>
                    </el-form>
                </div>

                <div style="flex: 1.5;margin-right: 10px">

                    <el-form>
                        <el-form-item label="发布时间">
                            <el-date-picker
                                    style="margin-left: 5px"
                                    v-model="searchTime"
                                    type="daterange"
                                    align="right"
                                    unlink-panels
                                    range-separator="至"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期"
                                    :picker-options="pickerOptionsSearch">
                            </el-date-picker>
                        </el-form-item>

                        <el-form-item label="发布人">
                            <el-input style="width: 350px" clearable v-model="searchPublisher"
                                      placeholder="请输入发布人"></el-input>
                        </el-form-item>
                    </el-form>
                </div>

                <div style="flex: 0.3;display: flex;flex-direction: column;margin-right:100px">
                    <el-button style="" type="primary" @click="searchByManyCondition" plain size="small "> 搜 索
                    </el-button>
                    <el-button style="margin-left: 0!important;margin-top: 20px" @click="resetCondition" plain
                               size="small "> 重 置
                    </el-button>
                </div>
            </div>

        </el-card>

        <!--                        公告信息表格        -->
        <el-card style="width: 100%; ">

            <!--                            公告信息    标题-->
            <div slot="header" class="clearfix">
                <span style="font-weight: bold;font-size: 18px">系统公告信息</span>
                <el-button style="float: right;margin-right: 10px" type="danger" @click="deleteSelectNotices">
                    删除选中
                </el-button>
                <el-button style="float: right;margin-right: 20px" type="primary" plain @click="showAddNotice">
                    添加公告
                </el-button>


                <!-- 添加公告信息的弹窗 -->
                <el-dialog title="添加公告" :visible.sync="dialogVisible_addNotice">
                    <el-form :model="add_notice" size="medium" :rules="rules" ref="addNoticeRef">

                        <el-form-item prop="title" label="标题" label-width="100px">
                            <el-input v-model="add_notice.title" placeholder="请输入标题"></el-input>
                        </el-form-item>

                        <el-form-item prop="content" label="公告内容" label-width="100px">
                            <el-input type="textarea" v-model="add_notice.content" placeholder="请输入公告内容"
                                      style="width: 482px;margin-left: 20px"></el-input>
                        </el-form-item>

                        <el-form-item prop="publisher" label="发布人" label-width="100px">
                            <el-select v-model="add_notice.publisher" placeholder="请选择发布人">
                                <el-option label="系统管理员" value="系统管理员"></el-option>
                                <el-option label="网站管理员" value="网站管理员"></el-option>
                                <el-option label="毕设学生" value="姓名"></el-option>
                            </el-select>
                        </el-form-item>

                        <el-form-item prop="publishTime" label="发布时间" label-width="100px">
                            <el-date-picker
                                    v-model="add_notice.publishTime"
                                    type="datetime"
                                    placeholder="选择发布日期时间"
                                    align="right"
                                    :picker-options="pickerOptionsAdd">
                            </el-date-picker>
                        </el-form-item>


                    </el-form>


                    <div slot="footer" class="dialog-footer">
                        <el-button type="warning" @click="resetAddNotice"> 重 置</el-button>
                        <el-button @click="cancelDialog_addNotice"> 取 消</el-button>
                        <el-button type="primary" @click="handleEdit_addNotice"> 确 定</el-button>
                    </div>

                </el-dialog>


                <!-- 删除公告信息的弹窗 -->
                <el-dialog
                        title="提示"
                        :visible.sync="dialogVisible_deleteSelect"
                        width="30%">
                    <span>真的要删除选中的所有信息吗？</span>
                    <span slot="footer" class="dialog-footer">
                                    <el-button @click="dialogVisible_deleteSelect = false">取 消</el-button>
                                    <el-button type="danger" @click="handleDeleteNotices">确 定</el-button>
                                </span>
                </el-dialog>


            </div>


            <!--                            公告信息列表    展示-->
            <template>
                <el-table height="362"
                          :header-cell-style="{fontSize: '14px','text-align':'center'}"
                          :cell-style="{'text-align':'center'}"
                          :data="systemNotice"
                          @selection-change="handleSelectCodeForTicket"
                          stripe
                          style="width: 100%">
                    <el-table-column
                            type="selection"
                            width="55">
                    </el-table-column>
                    <el-table-column width="50" label="序号" type="index" align="center"></el-table-column>
                    <el-table-column prop="title" show-overflow-tooltip label="标题" width="200px"></el-table-column>
                    <el-table-column prop="content" show-overflow-tooltip label="内容" width="350px"></el-table-column>
                    <el-table-column prop="publishTime" label="发布时间" width="180px"></el-table-column>
                    <el-table-column prop="publisher" label="发布人" width="130px"></el-table-column>
                    <el-table-column prop="id" label="公告ID" width="100px"></el-table-column>

                    <el-table-column label="操作">

                        <!--          编辑  +  删除   公告-->
                        <template slot-scope="scope">

                            <!--                                    查看详情        -->
                            <!--                                            查看详情按钮    -->
                            <!--                            <router-link style="margin: 0 10px" :to="{ path: '/manager/noticeInfo', query: { id: '23' } }">-->
                            <!--                                <el-button icon="el-icon-search" circle></el-button>-->
                            <!--                            </router-link>-->

                            <!--                                            编辑按钮    -->
                            <el-button type="primary" icon="el-icon-edit" circle
                                       @click="handleEditButton(scope.row)"></el-button>
                            <!--                                            删除按钮    -->
                            <el-button type="danger" icon="el-icon-delete" circle
                                       @click="handleDeleteButton(scope.row)"></el-button>


                            <!-- 删除公告信息的弹窗 -->
                            <el-dialog
                                    title="提示"
                                    :visible.sync="dialogVisible_delete"
                                    width="30%">
                                <span style="float: left">真的要删除这条信息吗？</span>
                                <span slot="footer" class="dialog-footer">
                                    <el-button @click="dialogVisible_delete = false">取 消</el-button>
                                    <el-button type="danger" @click="handleDeleteNotice">确 定</el-button>
                                </span>
                            </el-dialog>

                            <!-- 编辑信息的弹窗 -->
                            <el-dialog title="修改公告信息" :visible.sync="dialogFormVisible_edit">
                                <el-form :model="form_notice" size="medium" :rules="rules" ref="editNoticeRef">

                                    <el-form-item label="ID" label-width="100px">
                                        <el-input v-model="form_notice.id" :disabled="true"></el-input>
                                    </el-form-item>

                                    <el-form-item prop="title" label="标题" label-width="100px">
                                        <el-input v-model="form_notice.title" placeholder="请输入标题"></el-input>
                                    </el-form-item>

                                    <el-form-item prop="content" label="公告内容" label-width="100px">
                                        <el-input type="textarea" v-model="form_notice.content"
                                                  placeholder="请输入公告内容"
                                                  style="width: 500px;margin-left: 20px"></el-input>
                                    </el-form-item>

                                    <el-form-item prop="publisher" label="发布人" label-width="100px">
                                        <el-select v-model="form_notice.publisher" placeholder="请选择发布人"
                                                   style="width: 622px;margin-left: 53px">
                                            <el-option label="系统管理员" value="系统管理员"></el-option>
                                            <el-option label="网站管理员" value="网站管理员"></el-option>
                                            <el-option label="毕设学生" value="姓名"></el-option>
                                        </el-select>
                                    </el-form-item>

                                    <el-form-item prop="publishTime" label="发布时间" label-width="100px">
                                        <el-date-picker
                                                v-model="form_notice.publishTime"
                                                type="datetime"
                                                placeholder="选择日期时间"
                                                align="right"
                                                :picker-options="pickerOptionsEdit">
                                        </el-date-picker>
                                    </el-form-item>

                                </el-form>

                                <div slot="footer" class="dialog-footer">
                                    <el-button @click="cancelDialog_editNotice">取 消</el-button>
                                    <el-button type="primary" @click="handleEdit">确 定</el-button>
                                </div>

                            </el-dialog>
                        </template>
                    </el-table-column>


                </el-table>

            </template>

            <el-pagination
                    style="float: right;margin: 20px 0"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page.sync="currentPage"
                    :page-sizes="pageSizes"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next"
                    background
                    :total="total">
            </el-pagination>
            <!--
                            @size-change="handleSizeChange"          pageSize 改变时会触发
                            @current-change="handleCurrentChange"    currentPage 改变时会触发
            -->
        </el-card>

    </div>
</template>

<script>
import {defineComponent} from 'vue'
import dateUtil from '@/utils/dateUtil'

export default defineComponent({
    name: "SystemNotice",
    data() {
        return {
            dialogFormVisible_edit: false,          // 编辑按钮弹出框
            dialogVisible_delete: false,            // 删除按钮弹出框
            dialogVisible_deleteSelect: false,      // 选中删除按钮弹出框
            dialogVisible_addNotice: false,         // 添加公告按钮弹出框

            systemNotice: [],          // 存储系统通知

            form_notice: {},          // 存储当前操作的公告
            editPublishTime: '',      // 存储编辑的发布时间
            add_notice: {},            // 存储添加的公告信息

            deleteId: '',             // 存储要删除的id
            deleteIds: [],            // 存储被选中公告的id

            currentPage: 1,           // 当前页码
            pageSizes: [5, 10, 50, 100], // 每页显示条数
            pageSize: 5,              // 每页显示条数
            total: 0,                 // 公告总数

            searchTitle: '',           // 存储搜索的标题
            searchContent: '',         // 存储搜索的内容
            searchPublisher: '',       // 存储搜索的发布人
            searchTime: '',           // 存储搜素的时间
            startTime: '',            // 存储开始时间
            endTime: '',              // 存储结束时间

            // 搜素的日期选择器
            pickerOptionsSearch: {
                shortcuts: [{
                    text: '最近一周',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近三个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        picker.$emit('pick', [start, end]);
                    }
                }]
            },
            // 添加弹窗的时间选择器
            pickerOptionsAdd: {
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }, {
                    text: '昨天',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24);
                        picker.$emit('pick', date);
                    }
                }, {
                    text: '一周前',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', date);
                    }
                }]
            },

            // 修改弹窗的时间选择器
            pickerOptionsEdit: {
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }, {
                    text: '昨天',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24);
                        picker.$emit('pick', date);
                    }
                }, {
                    text: '一周前',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', date);
                    }
                }]
            },

            // 输入校验规则
            rules: {
                title: [
                    {required: true, message: '请输入标题', trigger: 'blur'},
                    {min: 4, message: '标题最少为4个字符', trigger: 'blur'}
                ],
                publisher: [
                    {required: true, message: '请选择发布人', trigger: 'blur'}
                ],
                content: [
                    {required: true, message: '请填写活动形式', trigger: 'blur'}
                ],
                publishTime: [
                    {required: true, message: '请选择日期', trigger: 'change'}
                ]
            }
        }
    },


    mounted() {
        this.$request.get('/systemNotice/selectByPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize).then(res => {
            if (res.code === '200') {
                this.systemNotice = res.data.list;
                this.total = res.data.total;
                // console.log(res.data)
            } else {
                this.$message.error(res.msg);
            }
        })
    },


    methods: {

        test() {
            console.log(this.searchTime[0])
            console.log(dateUtil.formatDate(this.searchTime[0]))
            console.log(this.searchTime[1])
            console.log(dateUtil.formatDate(this.searchTime[1]))
        },


        // 获取所有的公告信息
        selectALl() {
            this.$request.get('/systemNotice/selectByPage?currentPage=1&pageSize=5').then(res => {
                if (res.code === '200') {
                    this.systemNotice = res.data.list;
                    this.total = res.data.total;
                } else {
                    this.$message.error(res.msg)
                }
            })
        },

        // 重置查询条件
        resetCondition() {
            // 重置查询条件
            this.searchTitle = ''
            this.searchContent = ''
            this.searchPublisher = ''
            this.searchTime = ''
            this.startTime = ''
            this.endTime = ''
            //  重新查询
            this.searchByManyCondition()
            this.$message.success('重置成功')
        },

        // 条件查询
        searchByManyCondition() {
            if (this.searchTime === null) {
                this.searchTime = ''
            }

            // if (this.searchTime === '' && this.searchTitle === '' && this.searchContent === '' && this.searchPublisher === '') {
            //     this.$message.info('请至少输入一个查询条件')
            //     return
            // }

            // 处理时间段信息
            if (this.searchTime !== '') {
                this.startTime = dateUtil.formatDate(this.searchTime[0])
                this.endTime = dateUtil.formatDate(this.searchTime[1])
            } else {
                this.startTime = '1000-01-01 00:00:00'
                this.endTime = '9999-12-31 23:59:59'
            }

            this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                // console.log(res.data)
                this.startTime = this.startTime === '' ? '' : this.startTime
                this.endTime = this.endTime === '' ? '' : this.endTime
                if (res.code === '200') {
                    this.systemNotice = res.data.list
                    this.total = res.data.total
                    this.$message
                        .success('查询成功')
                } else {
                    this.$message.error(res.msg)
                }
            })
        },

        // 重置添加公告信息按钮
        resetAddNotice() {
            this.add_notice = {}
        },

        // 取消添加公告
        cancelDialog_addNotice() {
            this.dialogVisible_addNotice = false;
        },

        // 移除表单的校验
        clearcheck(formName) {
            if (this.$refs[formName]) {
                this.$refs[formName].clearValidate()
            }
        },

        // 添加公告
        handleEdit_addNotice() {

            this.$refs['addNoticeRef'].validate((valid) => {
                if (valid) {
                    // 校验通过
                    // 初始时间格式
                    this.add_notice.publishTime = dateUtil.formatDate(this.add_notice.publishTime)
                    this.$request.post('/systemNotice/addSystemNotice', this.add_notice).then(res => {
                        // 关闭弹窗
                        this.dialogVisible_addNotice = false;
                        this.add_notice = {}
                        if (res.code === '200') {
                            this.$message.success('添加成功')
                            // 刷新页面
                            this.selectByPage()
                        } else {
                            this.$message.error(res.msg)
                        }
                    })
                } else {
                    this.$message.error('请输入完整信息')
                }
            })
        },

        // 分页查找
        selectByPage() {
            this.$request.get('/systemNotice/selectByPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize).then(res => {
                if (res.code === '200') {
                    this.systemNotice = res.data.list;
                    this.total = res.data.total;
                } else {
                    this.$message.error(res.msg);
                }
            })
        },

        // currentPage 改变时会触发
        handleCurrentChange(val) {
            // 获取  当前页 和 页面大小  currentPage、pageSize
            this.currentPage = val;

            // 发送请求获取相应数量的数据

            // 处理时间段信息
            if (this.searchTime === null) {
                this.searchTime = ''
            }
            if (this.searchTime !== '') {
                this.startTime = dateUtil.formatDate(this.searchTime[0])
                this.endTime = dateUtil.formatDate(this.searchTime[1])
            } else {
                this.startTime = '1000-01-01 00:00:00'
                this.endTime = '9999-12-31 23:59:59'
            }

            this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                // console.log(res.data)
                this.startTime = this.startTime === '' ? '' : this.startTime
                this.endTime = this.endTime === '' ? '' : this.endTime
                if (res.code === '200') {
                    this.systemNotice = res.data.list
                    this.total = res.data.total
                } else {
                    this.$message.error(res.msg)
                }
            })
        },

        //  pageSize 改变时会触发
        handleSizeChange(val) {
            // 获取  当前页 和 页面大小  currentPage、pageSize
            this.pageSize = val;
            this.currentPage = 1;

            // 发送请求获取相应数量的数据

            // 处理时间段信息
            if (this.searchTime === null) {
                this.searchTime = ''
            }
            if (this.searchTime !== '') {
                this.startTime = dateUtil.formatDate(this.searchTime[0])
                this.endTime = dateUtil.formatDate(this.searchTime[1])
            } else {
                this.startTime = '1000-01-01 00:00:00'
                this.endTime = '9999-12-31 23:59:59'
            }

            this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                // console.log(res.data)
                this.startTime = this.startTime === '' ? '' : this.startTime
                this.endTime = this.endTime === '' ? '' : this.endTime
                if (res.code === '200') {
                    this.systemNotice = res.data.list
                    this.total = res.data.total
                } else {
                    this.$message.error(res.msg)
                }
            })
        },

        // 删除选中二次提醒
        deleteSelectNotices() {
            // 显示二次提醒弹窗
            this.dialogVisible_deleteSelect = true;
        },

        // 显示添加公告的弹出框
        showAddNotice() {
            this.clearcheck('addNoticeRef')
            this.dialogVisible_addNotice = true;
        },

        // 删除选中二次确认
        handleDeleteNotices() {
            console.log(this.deleteIds)
            this.dialogVisible_deleteSelect = false;
            if (this.deleteIds.length > 0) {
                // 删除选中
                this.$request.post('/systemNotice/deleteByIds', this.deleteIds).then(res => {
                    if (res.code === '200') {
                        this.$message.success('删除成功');
                        // 刷新数据
                        // 处理时间段信息
                        if (this.searchTime === null) {
                            this.searchTime = ''
                        }
                        if (this.searchTime !== '') {
                            this.startTime = dateUtil.formatDate(this.searchTime[0])
                            this.endTime = dateUtil.formatDate(this.searchTime[1])
                        } else {
                            this.startTime = '1000-01-01 00:00:00'
                            this.endTime = '9999-12-31 23:59:59'
                        }

                        this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                            // console.log(res.data)
                            this.startTime = this.startTime === '' ? '' : this.startTime
                            this.endTime = this.endTime === '' ? '' : this.endTime
                            if (res.code === '200') {
                                this.systemNotice = res.data.list
                                this.total = res.data.total
                            } else {
                                this.$message.error(res.msg)
                            }
                        })
                    } else {
                        this.$message.error(res.msg);
                    }
                })
            } else {
                this.$message.info('请选择要删除的公告');
            }

        },


        // 获取选中的公告id，
        // 并存储到 ids 数组中
        handleSelectCodeForTicket(val) {
            this.deleteIds = val.map((item) => item.id);
        },

        // 显示 修改公告信息    弹窗
        handleEditButton(notice) {
            this.clearcheck('editNoticeRef')
            // 将当前行的数据传入form中
            this.form_notice = JSON.parse(JSON.stringify(notice));
            this.editPublishTime = JSON.parse(JSON.stringify(notice.publishTime));
            // 显示弹窗
            this.dialogFormVisible_edit = true;
        },

        // 删除按钮二次提醒
        handleDeleteButton(notice) {
            this.dialogVisible_delete = true
            this.deleteId = notice.id
        },


        // 删除当前公告
        handleDeleteNotice() {
            this.dialogVisible_delete = false;

            this.$request.delete('/systemNotice/deleteById/' + this.deleteId).then(res => {
                if (res.code === '200') {
                    this.$message.success('删除成功');
                    this.deleteId = ''
                    // 重新加载数据
                    // 处理时间段信息
                    if (this.searchTime === null) {
                        this.searchTime = ''
                    }
                    if (this.searchTime !== '') {
                        this.startTime = dateUtil.formatDate(this.searchTime[0])
                        this.endTime = dateUtil.formatDate(this.searchTime[1])
                    } else {
                        this.startTime = '1000-01-01 00:00:00'
                        this.endTime = '9999-12-31 23:59:59'
                    }

                    this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                        // console.log(res.data)
                        this.startTime = this.startTime === '' ? '' : this.startTime
                        this.endTime = this.endTime === '' ? '' : this.endTime
                        if (res.code === '200') {
                            this.systemNotice = res.data.list
                            this.total = res.data.total
                        } else {
                            this.$message.error(res.msg)
                        }
                    })
                } else {
                    this.$message.error(res.msg);
                }
            })
        },

        // 取消修改信息
        cancelDialog_editNotice() {
            this.dialogFormVisible_edit = false;
            this.form_notice = {}
        },


        // 修改公告信息
        handleEdit() {
            this.dialogFormVisible_edit = false;
            // 格式化时间
            if (this.form_notice.publishTime !== this.editPublishTime) {
                this.form_notice.publishTime = dateUtil.formatDate(this.form_notice.publishTime)
            }

            // 输入检验
            this.$refs['editNoticeRef'].validate((valid) => {
                if (valid) {
                    // 校验通过
                    this.$request.put('/systemNotice/updateById', this.form_notice).then(res => {
                        console.log(res)
                        if (res.code === '200') {
                            this.$message.success('修改成功');
                            this.form_notice = {}
                            // 重新加载数据
                            if (this.searchTime === null) {
                                this.searchTime = ''
                            }

                            // 处理时间段信息
                            if (this.searchTime !== '') {
                                this.startTime = dateUtil.formatDate(this.searchTime[0])
                                this.endTime = dateUtil.formatDate(this.searchTime[1])
                            } else {
                                this.startTime = '1000-01-01 00:00:00'
                                this.endTime = '9999-12-31 23:59:59'
                            }

                            this.$request.get('/systemNotice/selectByManyConditionInPage?currentPage=' + this.currentPage + '&pageSize=' + this.pageSize + '&title=' + this.searchTitle + '&content=' + this.searchContent + '&publisher=' + this.searchPublisher + '&startTime=' + this.startTime + '&endTime=' + this.endTime).then(res => {
                                // console.log(res.data)
                                this.startTime = this.startTime === '' ? '' : this.startTime
                                this.endTime = this.endTime === '' ? '' : this.endTime
                                if (res.code === '200') {
                                    this.systemNotice = res.data.list
                                    this.total = res.data.total
                                } else {
                                    this.$message.error(res.msg)
                                }
                            })
                        } else {
                            this.$message.error(res.msg);
                        }
                    })
                } else {
                    this.$message.error('请输入完整信息')
                }
            })


        }


    }
})
</script>

<style scoped>

</style>